package univer.oko.queryAnalizer.sqlEditor.actions;


import univer.oko.queryAnalizer.sqlEditor.CDEditorPane;
import univer.oko.utilities.CDUtilities;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * Created by Sergey Kharlamov.
 * Date: 23.07.2006
 * Time: 18:04:20
 */
public class FindAction extends AbstractControlAction {

    public static final String TEXT = "find.action.text";
    private CDEditorPane textComponent;

    public FindAction(CDEditorPane textComponent) {
        super(TEXT, true, KeyStroke.getKeyStroke("control F"/*#Frozen*/), 'F',
                CDUtilities.createIcon("find.gif"));
        this.textComponent = textComponent;
    }

    public void actionPerformed(ActionEvent e) {
        textComponent.doFindAndReplace();
    }

    public boolean isControlAction() {
        return true;
    }

    public boolean shouldDisableIfNotPresent() {
        return true;
    }
}
